package body;

import image.ImageManager;

import java.awt.Graphics;

/**
 * 机枪兵
 */
public class Marine extends Body{
	
	public Dir direction = Dir.down;
	
	public State state = State.downStop;
	
	public Marine(int x, int y){
		super.setX(x);
		super.setY(y);
	}
	
	/**
	 * 速度
	 */
	public static final int speed = 10;
	
	
	
	
	
	
	int i = 0;
	State[] values = State.values();
	
	@Override
	public void draw(Graphics g) {
		
//		state = values[i];
//		i++;
//		if(i>23){
//			i=0;
//		}
		
		switch (state) {
		case upStop:
			g.drawImage(ImageManager.marine[0], getX(), getY(), null);
			break;
		case upMove1:
			g.drawImage(ImageManager.marine[1], getX(), getY(), null);
			break;
		case upMove2:
			g.drawImage(ImageManager.marine[2], getX(), getY(), null);
			break;
		case rightUpStop:
			g.drawImage(ImageManager.marine[3], getX(), getY(), null);
			break;
		case rightUpMove1:
			g.drawImage(ImageManager.marine[4], getX(), getY(), null);
			break;
		case rightUpMove2:
			g.drawImage(ImageManager.marine[5], getX(), getY(), null);
			break;
		case rightStop:
			g.drawImage(ImageManager.marine[6], getX(), getY(), null);
			break;
		case rightMove1:
			g.drawImage(ImageManager.marine[7], getX(), getY(), null);
			break;
		case rightMove2:
			g.drawImage(ImageManager.marine[8], getX(), getY(), null);
			break;
		case rightDownStop:
			g.drawImage(ImageManager.marine[9], getX(), getY(), null);
			break;
		case rightDownMove1:
			g.drawImage(ImageManager.marine[10], getX(), getY(), null);
			break;
		case rightDownMove2:
			g.drawImage(ImageManager.marine[11], getX(), getY(), null);
			break;
		case downStop:
			g.drawImage(ImageManager.marine[12], getX(), getY(), null);
			break;
		case downMove1:
			g.drawImage(ImageManager.marine[13], getX(), getY(), null);
			break;
		case downMove2:
			g.drawImage(ImageManager.marine[14], getX(), getY(), null);
			break;
		case leftDownStop:
			g.drawImage(ImageManager.marine[15], getX(), getY(), null);
			break;
		case leftDownMove1:
			g.drawImage(ImageManager.marine[16], getX(), getY(), null);
			break;
		case leftDownMove2:
			g.drawImage(ImageManager.marine[17], getX(), getY(), null);
			break;
		case leftStop:
			g.drawImage(ImageManager.marine[18], getX(), getY(), null);
			break;
		case leftMove1:
			g.drawImage(ImageManager.marine[19], getX(), getY(), null);
			break;
		case leftMove2:
			g.drawImage(ImageManager.marine[20], getX(), getY(), null);
			break;
		case leftUpStop:
			g.drawImage(ImageManager.marine[21], getX(), getY(), null);
			break;
		case leftUpMove1:
			g.drawImage(ImageManager.marine[22], getX(), getY(), null);
			break;
		case leftUpMove2:
			g.drawImage(ImageManager.marine[23], getX(), getY(), null);
			break;
		default:
			break;
		}
	}
}
